package com.lms.generictype.demo1;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-01-16 16:29
 * @Description: 泛型类使用
 */
public class Test {
    public static void main(String[] args) {
        List<String> strList = new ArrayList<>();
        strList.add("苹果手机");
        strList.add("华为手机");
        strList.add("笔记本电脑");
        strList.add("扫地机器人");
        strList.add("50元购物券");
        strList.add("法拉第5元抵用券");
        System.out.println(new ProductGetter<>(strList).getProduct());
        List<Integer> intList = new ArrayList<>();
        intList.add(1000);
        intList.add(500);
        intList.add(10000);
        intList.add(100);
        System.out.println(new ProductGetter<>(intList).getProduct());
        System.out.println(new ProductGetter<>(intList).getValue(true));
        System.out.println("---------------------------------");
    }
}
